package org.yray.sip.constant;


import java.util.HashMap;
import java.util.Map;

/**
 * public final static String SIP_CODE_480="480";
 public final static String SIP_CODE_503="503";
 public final static String SIP_CODE_500="500";
 public final static String SIP_CODE_487="487";

 */
public enum MediaCodeEnum {

    TOMAN_FAIL("8480", "转人工失败"),
    TOMAN_FAIL_CUST("8485", "转人工失败,客户挂的机"),
    TOMAN_SUCC("8481", "转人工成功"),
    TOMAN_EXT("8482", "已转到分机"),
    CALL_OUTTIME("8483", "外呼超时"),
    TOMAN_FIND_EXT("8486", "查分机"),
    TALK_STOP("8484", "停止播音"),
    MEDIA_REFRESH("7481", "刷新媒体"),
    BUILT_TTS("7482", "生成TTS"),
    ;
    private static Map<String, MediaCodeEnum> enumMap = new HashMap<>();

    static {
        for (MediaCodeEnum en : MediaCodeEnum.values()) {
            enumMap.put(en.getValue(), en);
        }
    }

    MediaCodeEnum(String value, String displayName) {
        this.value = value;
        this.displayName = displayName;
    }
    private String value;
    private String displayName;

    public static MediaCodeEnum parseCode(String code)
    {
       return enumMap.get(code);
    }


    public String getValue() {
        return value;
    }


    public String getDisplayName() {
        return displayName;
    }
}
